<script type="text/javascript" src="__PUBLIC__/Js/jquery.validator.reg.js"></script>
<link href="__PUBLIC__/Js/form_check/type.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	$('#addpbForm').checkForm();

	function doAddPBook(){
		var checkresult=checkFormItems('addpbForm');
		
		var form_ = $("#addpbForm");
		if(checkresult){
			//alert(checkresult);
			//提交表单
			$.kajax({      
				ajx_rtn_type:'JSON',
				url:"{:U('User://Account/doAddPhonebook')}",      
				type:'post', //数据发送方式  
				data:{mobile:form_.find('#mobile').val(),name:form_.find('#name').val()} ,    
				async: false ,//同步方式     
				success: function(objson){ 
								if(objson.status==1){
									k_success(objson.msg);
									goPage(1);
								}else{
									k_error(objson.msg);
								}
				}
			});
		}
	}

</script>
<div class="reg_box" id="login_area">
	<div style="width: auto; height: auto;padding: 15px 0px;" class="do_box">
		<div class="clear"></div>
		<form action="" method="post" id="addpbForm">
			<table cellspacing="0" cellpadding="0" border="0" align="center" class="do_list">
		    	<tbody>
					<tr>
				        <td height="50" align="right" width="90" valign="middle"><span class="reg_item">手机号：</span></td>
				        <td valign="middle">
				        <div class="mailline">
				            <input type="text" class="do_input s_input" value=""
				            name="mobile" id="mobile" require="true" datatype="mobile|ajax" style="width: 155px;"
				            url="{:U('User://Account/isMobileAvailable')}" msg="格式错误|号码已添加"/>
				        </div>
				        </td>
				        <td align="left" width="155" valign="middle">
				        	<div id="success_mobile" style="display:none;"> <span class="ico_cue_ok"></span> </div>
				          <div class="error_mobile" style="position: relative;display:none;">
				          	<span class="ico_cue_no"></span><span id="error_mobile"></span> </div>
					
				        </td>
					</tr>
					<tr>
				        <td height="50" align="right" valign="middle"><span class="reg_item">姓名：</span></td>
				        <td valign="middle">
				        	<input type="text" class="do_input s_input" value=""  style="width: 155px;"
				        		name="name" id="name" require="false" max="12"/>
				        </td>
				        <td align="left" valign="middle">
						</td>
					</tr>
		    	</tbody>
		    </table>
		</form>
	</div>
	<div class="c"></div>
	<div class="answers" style="">
	<input type="button" class="btn_ok" onclick="doAddPBook()" value="确定" id="k_confirm_btn">
	<input type="button" class="btn_cancel" onclick="ui.box.close()" value="取消" id="k_confirm_btn">
	</div>
</div>

